package com.feilx.changgou.search.controller;

import com.feilx.changgou.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

@RestController
public class SearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping("/search")
    public Map search(@RequestParam Map map) throws IOException {
        return searchService.search(map);
    }
    @GetMapping("/search1")
    public Map search1(@RequestParam Map map) throws IOException {
        return searchService.getAll(map);
    }
}
